<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>6.7. Linux-Libc-Headers-2.6.12.0</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第六章 安装系统基础软件</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="createfiles.html" title="创建必需的文件与符号连接">后退</a>
          <p>创建必需的文件与符号连接</p>
        </li>
        <li class="next">
          <a accesskey="n" href="man-pages.html" title="Man-pages-2.34">前进</a>
          <p>Man-pages-2.34</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">6.7. Linux-Libc-Headers-2.6.12.0</h1>
      </div>
      <div class="package">
        <p>Linux-Libc-Headers 包含"纯净的"内核头文件。</p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">少于 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">27 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation">
        <div class="titlepage">
          <h2 class="sect2">6.7.1. 安装 Linux-Libc-Headers</h2>
        </div>
        <p>多年来，通常的做法是直接从内核源代码中复制出"原始"内核头文件，放在 /usr/include 中使用。但是最近几年，内核开发人员强烈要求停止这种做法。因此诞生了 Linux-Libc-Headers 项目，其目的就是维护一个 API 版本稳定的内核头文件。</p>
        <p>添加一个用户空间头文件和新内核对于inotify特性的系统调用支持:</p>
        <pre class="userinput"><kbd class="command">patch -Np1 -i ../linux-libc-headers-2.6.12.0-inotify-3.patch</kbd></pre>
        <p>安装内核头文件：</p>
        <pre class="userinput"><kbd class="command">install -dv /usr/include/asm
cp -Rv include/asm-i386/* /usr/include/asm
cp -Rv include/linux /usr/include</kbd></pre>
        <p>确保这些头文件的所有者是 root ：</p>
        <pre class="userinput"><kbd class="command">chown -Rv root:root /usr/include/{asm,linux}</kbd></pre>
        <p>确保用户可以读取这些头文件：</p>
        <pre class="userinput"><kbd class="command">find /usr/include/{asm,linux} -type d -exec chmod -v 755 {} \;
find /usr/include/{asm,linux} -type f -exec chmod -v 644 {} \;</kbd></pre>
      </div>
      <div class="content">
        <div class="titlepage">
          <a id="contents-linux-libc-headers" name="contents-linux-libc-headers"></a>
          <h2 class="sect2">6.7.2. Linux-Libc-Headers 的内容</h2>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">安装的头文件：</span></strong> <span class="seg">/usr/include/{asm,linux}/*.h</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3><a id="id3674054" name="id3674054"></a>简要描述</h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td><a id="linux-libc-headers" name="linux-libc-headers"></a><span class="term"><tt class="filename">/usr/include/{asm,linux}/*.h</tt></span></td>
                <td><p>内核头文件 API</p></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="createfiles.html" title="创建必需的文件与符号连接">后退</a>
          <p>创建必需的文件与符号连接</p>
        </li>
        <li class="next">
          <a accesskey="n" href="man-pages.html" title="Man-pages-2.34">前进</a>
          <p>Man-pages-2.34</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
